<?php
namespace app\controllers\api\account;

use app\models\User;
use app\libs\LibUser;

// 获取登录用户信息
class GetloginuserController extends \app\controllers\ForceLoginPure {

    public function run() {
        $uid = LibUser::getLoginUid();

        $user = new User();
        $data = $user->getOne('id, gender, user_name, email, avatar, short_intro, role, birthday, status', $uid);
        $data['str_uid'] = LibUser::encodeId($data['id']);

        $this->ajaxReturn([
            'data' => $data
        ]);
    }

}
